package com.ysd.lis.controller.bac;


import com.fasterxml.jackson.core.JsonProcessingException;
import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.request.lab.DefResultDto;
import com.ysd.lis.request.lab.DefResultParam;
import com.ysd.lis.service.bac.BacFlowDefResultService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 细菌描述性结果选项 前端控制器
 * </p>
 *
 * @author whx
 * @since 2025-01-24
 */
@RestController
@RequestMapping("/api/bac/flowDefResult")
public class BacFlowDefResultController extends BaseController {

    @Autowired
    BacFlowDefResultService bacFlowDefResultService;

    @ApiOperation("查询")
    @GetMapping("/findFlowDefResultList")
    public Result findFlowDefResultList(DefResultParam param){
        return bacFlowDefResultService.findFlowDefResultList(param);
    }

    @ApiOperation("修改")
    @PostMapping("/saveOrUpdateFlowDefResult")
    public Result saveOrUpdateFlowDefResult(@RequestBody DefResultDto dto) {
        return bacFlowDefResultService.saveOrUpdateFlowDefResult(dto);
    }

    @ApiOperation("批量删除")
    @PostMapping("/batchDeleteFlowDefResult")
    public Result batchDeleteFlowDefResult(@RequestBody DefResultDto dto){
        return  bacFlowDefResultService.batchDeleteFlowDefResult(dto);
    }

    @ApiOperation("根据条码获取")
    @GetMapping("/getBacMaininfoByReqNo")
    public Result getBacMaininfoByReqNo(DefResultParam param) {
        return bacFlowDefResultService.getBacMaininfoByReqNo(param);
    }

    @ApiOperation("批量删除")
    @PostMapping("/batchDeleteBacTestResult")
    public Result batchDeleteBacTestResult(@RequestBody DefResultDto dto){
        return  bacFlowDefResultService.batchDeleteBacTestResult(dto);
    }

    @ApiOperation("批量保存")
    @PostMapping("/batchSaveBacTestResult")
    public Result batchSaveBacTestResult(@RequestBody DefResultDto dto){
        return  bacFlowDefResultService.batchSaveBacTestResult(dto);
    }

    @ApiOperation("批量审核")
    @PostMapping("/batchChkBacTestResult")
    public Result batchChkBacTestResult(@RequestBody DefResultDto dto){
        return  bacFlowDefResultService.batchChkBacTestResult(dto);
    }
    @ApiOperation("批量消审")
    @PostMapping("/batchUnChkBacTestResult")
    public Result batchUnChkBacTestResult(@RequestBody DefResultDto dto) throws JsonProcessingException  {
        return  bacFlowDefResultService.batchUnChkBacTestResult(dto);
    }
}
